﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MyExcelAddIn2003.ComOPHelper;
using MyExcelAddIn2003.Core;

namespace MyExcelAddIn2003.Weight
{
    public partial class WTSencondCheckFrm : Form
    {
        public WTSencondCheckFrm()
        {
            InitializeComponent();
        }
        public WTSencondCheckFrm(string CHName, string CPHM, string SJXM, string LLCZ, string BCCZ,string CZFlag)
        {
            InitializeComponent();
            textBox_CH.Text = "" + CHName;
            textBox_CPHM.Text = "" + CPHM;
            textBox_SJXM.Text = "" + SJXM;
            textBox_ybzl.Text = "" + LLCZ;
            textBox_dqzl.Text = "" + BCCZ;
            if (CZFlag == "采毛")
            {
                label_ybzl.Text = "仪表毛重";
                label_cz.Text = "本次毛重";
                WtBtn.Text = "采  毛";
                WtBtn.Click += new EventHandler(CaiMao_Click);
            }
            else
            {
                label_ybzl.Text = "仪表皮重";
                label_cz.Text = "本次皮重";
                WtBtn.Text = "采  皮";
                WtBtn.Click += new EventHandler(CaiPi_Click);
            }
        }
        private void CaiMao_Click(object sender, EventArgs e)
        {
            try
            {
                VBAfunc.WTSencondCheckFrm_CaiMao_Click(textBox_ybzl.Text,textBox_dqzl.Text,Utility.CurrentWeightNum);
                OPHelper op = new OPHelper();
                op.SetSheetToMainForm();
            }
            catch
            {

            }
            this.Close();
        }
        private void CaiPi_Click(object sender, EventArgs e)
        {
            try
            {
                VBAfunc.WTSencondCheckFrm_CaiPi_Click(textBox_ybzl.Text, textBox_dqzl.Text, Utility.CurrentWeightNum);
                OPHelper op = new OPHelper();
                op.SetSheetToMainForm();
            }
            catch
            {

            }
            this.Close();
        }

        private void CancelBtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
